class Warehouse < ActiveRecord::Base
  belongs_to :company
  belongs_to :warehouse_type
  def self.findByName warehouseName
    all(:conditions => ['name like ?','%'+warehouseName+'%'],:include=>[:warehouse_type])
  end

  scope :paginate, ->(start,limit) { offset(start.to_i).limit(limit.to_i).order("id DESC")}
end
